\hypertarget{classpg_event_manager}{\section{pg\-Event\-Manager Class Reference}
\label{classpg_event_manager}\index{pg\-Event\-Manager@{pg\-Event\-Manager}}
}


Pale\-Gem's generic event manager.  




{\ttfamily \#include $<$pg\-Event\-Manager.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classpg_event_manager_a5d1c2a37af67527d92b21ba479ce4209}{pg\-Event\-Manager} ()
\item 
\hyperlink{classpg_event_manager_ad2b6a0101c3a662053a7e9412b0a45e2}{$\sim$pg\-Event\-Manager} ()
\item 
void \hyperlink{classpg_event_manager_ab46948a665a7dc917cd7ddd923b96df7}{Shut\-Down} ()
\item 
void \hyperlink{classpg_event_manager_a55f2390b23692eb1766b969c21fa5a82}{Update} (float frame\-Time)
\item 
void \hyperlink{classpg_event_manager_adcb884715e5eae15fd26de23c37dad5c}{Register\-Listener} (\hyperlink{class_i_event_listener}{I\-Event\-Listener} $\ast$listener, int event\-Class=\hyperlink{_i_event_manager_8h_ab13f1eb4f7990ad6a97263126b1e8565a230d22d3c096db888df52a0e5d5ba7ac}{E\-C\-\_\-\-U\-N\-K\-N\-O\-W\-N}, int event\-Name=\hyperlink{_i_event_manager_8h_acebeb2e728025f3444b405355a3f8e92a0bdce79d948b8215713bcf669df0b8f1}{E\-\_\-\-U\-N\-K\-N\-O\-W\-N})
\item 
void \hyperlink{classpg_event_manager_a35853037c0fa92fb8ec52e8b0f5392d2}{Unregister\-Listener} (\hyperlink{class_i_event_listener}{I\-Event\-Listener} $\ast$listener)
\item 
void \hyperlink{classpg_event_manager_acfc2fdad64e4ff9c0e2269d89bb3fc8f}{Register\-Event} (int event\-Name, int event\-Class, \hyperlink{struct_i_event_data}{I\-Event\-Data} $\ast$p\-Data)
\item 
void \hyperlink{classpg_event_manager_a4efdfeaf8170aaa9359af445f7c1d98d}{Register\-Critical\-Error\-Listener} (\hyperlink{class_i_event_listener}{I\-Event\-Listener} $\ast$p\-Listener)
\begin{DoxyCompactList}\small\item\em Registers only for critical error event (E\-\_\-\-O\-N\-C\-R\-I\-T\-I\-C\-A\-L\-\_\-\-E\-R\-R\-O\-R). \end{DoxyCompactList}\item 
void \hyperlink{classpg_event_manager_af569c1d06e3afe6bdb8d1d147a2b43ee}{Unregister\-Critical\-Error\-Listener} (\hyperlink{class_i_event_listener}{I\-Event\-Listener} $\ast$p\-Listener)
\begin{DoxyCompactList}\small\item\em Unregisters an error-\/only listener. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classpg_event_manager_a9da178be93be081577391abdf5015693}{Fire\-Events} ()
\begin{DoxyCompactList}\small\item\em Fires all events in the queue. \end{DoxyCompactList}\item 
void \hyperlink{classpg_event_manager_a25e53266444d27b59721de5d85a3f46e}{Fire\-Critical\-Error\-Event} ()
\begin{DoxyCompactList}\small\item\em Fires a special event that can be used to save shutdown if a critical error has appeared. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
std\-::list$<$ \hyperlink{struct_s_listener_ex}{S\-Listener\-Ex} $\ast$ $>$ \hyperlink{classpg_event_manager_a6bb8e223e41d32c6659ad1d1ae71e205}{extended\-Register}
\begin{DoxyCompactList}\small\item\em Here all listeners are queued. \end{DoxyCompactList}\item 
std\-::list$<$ \hyperlink{struct_i_event}{I\-Event} $\ast$ $>$ \hyperlink{classpg_event_manager_a9d1c1cd6a5c90f36a5f975fbc780fcff}{event\-Queue}
\begin{DoxyCompactList}\small\item\em Here all events are queued. \end{DoxyCompactList}\item 
std\-::list$<$ \hyperlink{class_i_event_listener}{I\-Event\-Listener} $\ast$ $>$ \hyperlink{classpg_event_manager_afc696019a80edb2f678a7626e61dd951}{error\-Listeners}
\begin{DoxyCompactList}\small\item\em Used for listeners who only want to receive critical error events. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Pale\-Gem's generic event manager. 

If you need your own event manager for different things, you can either derive directly from \hyperlink{classpg_event_manager}{pg\-Event\-Manager} (lazy, possible performance drawbacks) or you can derive from \hyperlink{class_i_event_manager}{I\-Event\-Manager} to implement your own distribution algorhythms. C\-A\-U\-T\-I\-O\-N\-: Events are dynamically allocated and passed as pointers. T\-H\-E E\-V\-E\-N\-T\-M\-A\-N\-A\-G\-E\-R T\-A\-K\-E\-S C\-A\-R\-E O\-F F\-R\-E\-E\-I\-N\-G M\-E\-M\-O\-R\-Y F\-O\-R E\-V\-E\-N\-T\-S! This means events are only existant for one frame, if you need data from and event longer than one frame, you should make a copy of the data. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classpg_event_manager_a5d1c2a37af67527d92b21ba479ce4209}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!pg\-Event\-Manager@{pg\-Event\-Manager}}
\index{pg\-Event\-Manager@{pg\-Event\-Manager}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{pg\-Event\-Manager}]{\setlength{\rightskip}{0pt plus 5cm}pg\-Event\-Manager\-::pg\-Event\-Manager (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classpg_event_manager_a5d1c2a37af67527d92b21ba479ce4209}
\hypertarget{classpg_event_manager_ad2b6a0101c3a662053a7e9412b0a45e2}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!$\sim$pg\-Event\-Manager@{$\sim$pg\-Event\-Manager}}
\index{$\sim$pg\-Event\-Manager@{$\sim$pg\-Event\-Manager}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{$\sim$pg\-Event\-Manager}]{\setlength{\rightskip}{0pt plus 5cm}pg\-Event\-Manager\-::$\sim$pg\-Event\-Manager (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classpg_event_manager_ad2b6a0101c3a662053a7e9412b0a45e2}


\subsection{Member Function Documentation}
\hypertarget{classpg_event_manager_a25e53266444d27b59721de5d85a3f46e}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!Fire\-Critical\-Error\-Event@{Fire\-Critical\-Error\-Event}}
\index{Fire\-Critical\-Error\-Event@{Fire\-Critical\-Error\-Event}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{Fire\-Critical\-Error\-Event}]{\setlength{\rightskip}{0pt plus 5cm}void pg\-Event\-Manager\-::\-Fire\-Critical\-Error\-Event (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [private]}}}\label{classpg_event_manager_a25e53266444d27b59721de5d85a3f46e}


Fires a special event that can be used to save shutdown if a critical error has appeared. 

\hypertarget{classpg_event_manager_a9da178be93be081577391abdf5015693}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!Fire\-Events@{Fire\-Events}}
\index{Fire\-Events@{Fire\-Events}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{Fire\-Events}]{\setlength{\rightskip}{0pt plus 5cm}void pg\-Event\-Manager\-::\-Fire\-Events (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [private]}}}\label{classpg_event_manager_a9da178be93be081577391abdf5015693}


Fires all events in the queue. 

\hypertarget{classpg_event_manager_a4efdfeaf8170aaa9359af445f7c1d98d}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!Register\-Critical\-Error\-Listener@{Register\-Critical\-Error\-Listener}}
\index{Register\-Critical\-Error\-Listener@{Register\-Critical\-Error\-Listener}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{Register\-Critical\-Error\-Listener}]{\setlength{\rightskip}{0pt plus 5cm}void pg\-Event\-Manager\-::\-Register\-Critical\-Error\-Listener (
\begin{DoxyParamCaption}
\item[{{\bf I\-Event\-Listener} $\ast$}]{p\-Listener}
\end{DoxyParamCaption}
)}}\label{classpg_event_manager_a4efdfeaf8170aaa9359af445f7c1d98d}


Registers only for critical error event (E\-\_\-\-O\-N\-C\-R\-I\-T\-I\-C\-A\-L\-\_\-\-E\-R\-R\-O\-R). 

Can be used by classes who need to be notified on critical errors, but otherwhise do not need to receive any updates 
\begin{DoxyParams}{Parameters}
{\em p\-Listener} & Pointer to the listener that wants to receive E\-\_\-\-O\-N\-C\-I\-R\-T\-I\-C\-A\-L\-\_\-\-E\-R\-R\-O\-R events. \\
\hline
\end{DoxyParams}
\hypertarget{classpg_event_manager_acfc2fdad64e4ff9c0e2269d89bb3fc8f}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!Register\-Event@{Register\-Event}}
\index{Register\-Event@{Register\-Event}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{Register\-Event}]{\setlength{\rightskip}{0pt plus 5cm}void pg\-Event\-Manager\-::\-Register\-Event (
\begin{DoxyParamCaption}
\item[{int}]{event\-Name = {\ttfamily {\bf E\-\_\-\-U\-N\-K\-N\-O\-W\-N}}, }
\item[{int}]{event\-Class = {\ttfamily {\bf E\-C\-\_\-\-U\-N\-K\-N\-O\-W\-N}}, }
\item[{{\bf I\-Event\-Data} $\ast$}]{p\-Data = {\ttfamily NULL}}
\end{DoxyParamCaption}
)}}\label{classpg_event_manager_acfc2fdad64e4ff9c0e2269d89bb3fc8f}
\hypertarget{classpg_event_manager_adcb884715e5eae15fd26de23c37dad5c}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!Register\-Listener@{Register\-Listener}}
\index{Register\-Listener@{Register\-Listener}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{Register\-Listener}]{\setlength{\rightskip}{0pt plus 5cm}void pg\-Event\-Manager\-::\-Register\-Listener (
\begin{DoxyParamCaption}
\item[{{\bf I\-Event\-Listener} $\ast$}]{listener, }
\item[{int}]{event\-Class = {\ttfamily {\bf E\-C\-\_\-\-U\-N\-K\-N\-O\-W\-N}}, }
\item[{int}]{event\-Name = {\ttfamily {\bf E\-\_\-\-U\-N\-K\-N\-O\-W\-N}}}
\end{DoxyParamCaption}
)}}\label{classpg_event_manager_adcb884715e5eae15fd26de23c37dad5c}
\hypertarget{classpg_event_manager_ab46948a665a7dc917cd7ddd923b96df7}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!Shut\-Down@{Shut\-Down}}
\index{Shut\-Down@{Shut\-Down}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{Shut\-Down}]{\setlength{\rightskip}{0pt plus 5cm}void pg\-Event\-Manager\-::\-Shut\-Down (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classpg_event_manager_ab46948a665a7dc917cd7ddd923b96df7}
\hypertarget{classpg_event_manager_af569c1d06e3afe6bdb8d1d147a2b43ee}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!Unregister\-Critical\-Error\-Listener@{Unregister\-Critical\-Error\-Listener}}
\index{Unregister\-Critical\-Error\-Listener@{Unregister\-Critical\-Error\-Listener}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{Unregister\-Critical\-Error\-Listener}]{\setlength{\rightskip}{0pt plus 5cm}void pg\-Event\-Manager\-::\-Unregister\-Critical\-Error\-Listener (
\begin{DoxyParamCaption}
\item[{{\bf I\-Event\-Listener} $\ast$}]{p\-Listener}
\end{DoxyParamCaption}
)}}\label{classpg_event_manager_af569c1d06e3afe6bdb8d1d147a2b43ee}


Unregisters an error-\/only listener. 

Should be used by every class that registered for E\-\_\-\-O\-N\-C\-R\-I\-T\-I\-C\-A\-L\-\_\-\-E\-R\-R\-O\-R only, otherwhise memory access violation may occur. 
\begin{DoxyParams}{Parameters}
{\em p\-Listener} & The listener that needs to be unregistered. \\
\hline
\end{DoxyParams}
\hypertarget{classpg_event_manager_a35853037c0fa92fb8ec52e8b0f5392d2}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!Unregister\-Listener@{Unregister\-Listener}}
\index{Unregister\-Listener@{Unregister\-Listener}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{Unregister\-Listener}]{\setlength{\rightskip}{0pt plus 5cm}void pg\-Event\-Manager\-::\-Unregister\-Listener (
\begin{DoxyParamCaption}
\item[{{\bf I\-Event\-Listener} $\ast$}]{listener}
\end{DoxyParamCaption}
)}}\label{classpg_event_manager_a35853037c0fa92fb8ec52e8b0f5392d2}
\hypertarget{classpg_event_manager_a55f2390b23692eb1766b969c21fa5a82}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!Update@{Update}}
\index{Update@{Update}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{Update}]{\setlength{\rightskip}{0pt plus 5cm}void pg\-Event\-Manager\-::\-Update (
\begin{DoxyParamCaption}
\item[{float}]{frame\-Time}
\end{DoxyParamCaption}
)}}\label{classpg_event_manager_a55f2390b23692eb1766b969c21fa5a82}


\subsection{Member Data Documentation}
\hypertarget{classpg_event_manager_afc696019a80edb2f678a7626e61dd951}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!error\-Listeners@{error\-Listeners}}
\index{error\-Listeners@{error\-Listeners}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{error\-Listeners}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<${\bf I\-Event\-Listener}$\ast$$>$ pg\-Event\-Manager\-::error\-Listeners\hspace{0.3cm}{\ttfamily [private]}}}\label{classpg_event_manager_afc696019a80edb2f678a7626e61dd951}


Used for listeners who only want to receive critical error events. 

\hypertarget{classpg_event_manager_a9d1c1cd6a5c90f36a5f975fbc780fcff}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!event\-Queue@{event\-Queue}}
\index{event\-Queue@{event\-Queue}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{event\-Queue}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<${\bf I\-Event}$\ast$$>$ pg\-Event\-Manager\-::event\-Queue\hspace{0.3cm}{\ttfamily [private]}}}\label{classpg_event_manager_a9d1c1cd6a5c90f36a5f975fbc780fcff}


Here all events are queued. 

\hypertarget{classpg_event_manager_a6bb8e223e41d32c6659ad1d1ae71e205}{\index{pg\-Event\-Manager@{pg\-Event\-Manager}!extended\-Register@{extended\-Register}}
\index{extended\-Register@{extended\-Register}!pgEventManager@{pg\-Event\-Manager}}
\subsubsection[{extended\-Register}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<${\bf S\-Listener\-Ex}$\ast$$>$ pg\-Event\-Manager\-::extended\-Register\hspace{0.3cm}{\ttfamily [private]}}}\label{classpg_event_manager_a6bb8e223e41d32c6659ad1d1ae71e205}


Here all listeners are queued. 



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
Inc/\hyperlink{pg_event_manager_8h}{pg\-Event\-Manager.\-h}\item 
Source/\hyperlink{pg_event_manager_8cpp}{pg\-Event\-Manager.\-cpp}\end{DoxyCompactItemize}
